//
//  UINavigationController+Extension.m
//  OSChina
//
//  Created by 王洪运 on 15/12/16.
//  Copyright © 2015年 王洪运. All rights reserved.
//

#import "UINavigationController+Extension.h"

@implementation UINavigationController (Extension)

+(instancetype)navigationControllerWithViewController:(UIViewController *)viewController andTitle:(NSString *)title andImageName:(NSString *)imageName {
    
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewController];
    [viewController setTitle:title];
    [viewController.tabBarItem setImage:[UIImage imageNamed:imageName]];
    [viewController.tabBarItem setSelectedImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@-selected",imageName]]];
    
    return  nav;
}

@end
